//!Includes

#include "DriverGnuPlot.h"


//!Global Functions


namespace driver
{

/**
 * class Driver
 *
 *
 * Autor:David Bevilaqua
 *
 *
 * DESCRIPTION:
 *
 */

//!Constructors/Destructors

/**
 * Empty Constructor
 */
DriverGnuPlot::DriverGnuPlot ( )
{
	initAttributes ();
}

/**
 * Empty Destructor
 */
DriverGnuPlot::~DriverGnuPlot ( )
{
	gnuplot_close(m_pHandle) ;
}

//!Public Accessor Methods
void  DriverGnuPlot::SetLabelX (std::string string )
{
	char buf[30];
	sprintf(buf, string.c_str() );
	gnuplot_setstyle(m_pHandle,buf);
}
void  DriverGnuPlot::SetLabelY (std::string string )
{
	char buf[30];
	sprintf(buf, string.c_str() );
	gnuplot_setstyle(m_pHandle,buf);
}
void  DriverGnuPlot::SetStyle(std::string string )
{
	char buf[30];
	sprintf(buf, string.c_str() );
	gnuplot_setstyle(m_pHandle,buf);
}


//!Public Methods
void  DriverGnuPlot::PlotXY (std::string string )
{
	char buf[30];
	sprintf(buf, string.c_str() );
	gnuplot_plot_xy(m_pHandle,m_pPointsX,m_pPointsY,m_MaxPoints,buf);
}
void  DriverGnuPlot::PlotX (std::string string )
{
	char buf[30];
	sprintf(buf, string.c_str() );
	gnuplot_plot_x(m_pHandle,m_pPointsY,m_MaxPoints,buf);
}
void DriverGnuPlot::ResetPlot ( )
{
	gnuplot_resetplot(m_pHandle);
}

//!Protected Methods



//!Private Methods


/**
 * Starts all the attributes of
 * the Driver
 */
void DriverGnuPlot::initAttributes ( )
{
	m_pHandle= gnuplot_init() ;

}


}
